package day06;

import java.util.Arrays;
import java.util.Random;

public class MethodDemo {
    public static void main(String[] args) {
        say();
        eat("鱼");
        info("涂山美美",16);
        int[] arr = generateArray(10,18);
        System.out.println(Arrays.toString(arr));



    }
    public static void say(){
        System.out.println("说");
    }
    public static void eat(String food){
        System.out.println("吃"+food);
    }
    public static void info(String name,int age){
        System.out.println("名字："+name+"，年龄："+age);
    }

    /**
     * 生成一个整型数组随机填充数据
     * @param length 数组长度
     * @param max 最大限定值
     * @return arr
     */
    public static int[] generateArray(int length,int max){
        int[] arr = new int[length];
        Random random = new Random();
        for(int i = 0;i<length;i++){
            arr[i] = random.nextInt(max)+1;

        }
        return arr;
    }

}
